﻿#include "WgtSqlManage.h"
#include <QApplication>
#include <QFormLayout>
#include <QDebug>
#include <QTabBar>

#pragma execution_character_set("utf-8")

WgtSqlManage::WgtSqlManage(QString title, QWidget *parent)
    : QGroupBox{title, parent}
{
    setupUi();
}

void WgtSqlManage::addConfigWgt(QString name, QWidget *wgt)
{
    tabwgt->addTab(wgt, name);
}

void WgtSqlManage::removeConfigWgt(QString name)
{
    for(int i = 0; i < tabwgt->count(); ++i){
        if(tabwgt->tabText(i) == "name"){
            tabwgt->removeTab(i);
            break;
        }
    }
}

void WgtSqlManage::setupUi()
{
    QHBoxLayout* hLayout = new QHBoxLayout();
    this->setLayout(hLayout);
    tabwgt = new QTabWidget();
    hLayout->addWidget(tabwgt);
}

